package com.dsteiner.widgets.server.dao;

import com.dsteiner.widgets.client.ObjectUtil;

public class Parameter {

	private String name;
	private String comparator = "==";
	private Object value;
	private String type = "String";
	
	public Parameter(String name, Object value) {
		this.name = name;
		this.comparator = comparator;
		this.value = value;
	}
	
	public String getComparator() {
		return comparator;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getName() {
		return name;
	}
	public Object getValue() {
		return value;
	}
	public void setComparator(String comparator) {
		this.comparator = comparator;
	}
	public boolean equals(Object obj) {
		if (obj == null)
			return false;
		if (!(obj instanceof Parameter))
			return false;
		Parameter other = (Parameter) obj;
		return ObjectUtil.equals(type, other.type) && ObjectUtil.equals(value, other.value) &&
		ObjectUtil.equals(comparator, other.comparator) && ObjectUtil.equals(name, other.name);
	}
	@Override
	public String toString() {
		return name+comparator+value;
	}
}
